﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

namespace Camc.Quality.Migrations
{
    public partial class Add_Instruction : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "FormInstructionRelations",
                columns: table => new
                {
                    Id = table.Column<Guid>(nullable: false),
                    CreationTime = table.Column<DateTime>(nullable: false),
                    CreatorUserId = table.Column<long>(nullable: true),
                    LastModificationTime = table.Column<DateTime>(nullable: true),
                    LastModifierUserId = table.Column<long>(nullable: true),
                    IsDeleted = table.Column<bool>(nullable: false),
                    DeleterUserId = table.Column<long>(nullable: true),
                    DeletionTime = table.Column<DateTime>(nullable: true),
                    FormId = table.Column<Guid>(nullable: false),
                    IsImplement = table.Column<int>(nullable: false),
                    IsFeedback = table.Column<int>(nullable: false),
                    FeedbackContent = table.Column<string>(nullable: true),
                    FeedbackTime = table.Column<DateTime>(nullable: true),
                    IsFinsh = table.Column<int>(nullable: false),
                    TechniqueNum = table.Column<string>(nullable: true),
                    TechniqueName = table.Column<string>(nullable: true),
                    TechniqueEntityId = table.Column<Guid>(nullable: false),
                    ProcessesEntityId = table.Column<Guid>(nullable: false),
                    ProcessesEntityName = table.Column<string>(nullable: true),
                    WorkStepEntityName = table.Column<string>(nullable: true),
                    WorkStepEntityId = table.Column<Guid>(nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_FormInstructionRelations", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "InstructionEntities",
                columns: table => new
                {
                    Id = table.Column<Guid>(nullable: false),
                    CreationTime = table.Column<DateTime>(nullable: false),
                    CreatorUserId = table.Column<long>(nullable: true),
                    LastModificationTime = table.Column<DateTime>(nullable: true),
                    LastModifierUserId = table.Column<long>(nullable: true),
                    IsDeleted = table.Column<bool>(nullable: false),
                    DeleterUserId = table.Column<long>(nullable: true),
                    DeletionTime = table.Column<DateTime>(nullable: true),
                    OId = table.Column<Guid>(nullable: false),
                    Code = table.Column<string>(nullable: true),
                    Name = table.Column<string>(nullable: true),
                    Model = table.Column<string>(nullable: true),
                    FaCi = table.Column<string>(nullable: true),
                    SecrecyLevel = table.Column<string>(nullable: true),
                    StageSign = table.Column<string>(nullable: true),
                    Version = table.Column<string>(nullable: true),
                    FileName = table.Column<string>(nullable: true),
                    FileNum = table.Column<string>(nullable: true),
                    State = table.Column<int>(nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_InstructionEntities", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "MomentAndMultiMediaCheckForm",
                columns: table => new
                {
                    Id = table.Column<Guid>(nullable: false),
                    CreationTime = table.Column<DateTime>(nullable: false),
                    CreatorUserId = table.Column<long>(nullable: true),
                    LastModificationTime = table.Column<DateTime>(nullable: true),
                    LastModifierUserId = table.Column<long>(nullable: true),
                    IsDeleted = table.Column<bool>(nullable: false),
                    DeleterUserId = table.Column<long>(nullable: true),
                    DeletionTime = table.Column<DateTime>(nullable: true),
                    FormEntityId = table.Column<Guid>(nullable: false),
                    Num = table.Column<int>(nullable: false),
                    InstructionEntityId = table.Column<Guid>(nullable: false),
                    Processes = table.Column<string>(nullable: true),
                    ProcessesNum = table.Column<int>(nullable: false),
                    OldId = table.Column<string>(nullable: true),
                    ModeCode = table.Column<string>(nullable: true),
                    Name = table.Column<string>(nullable: true),
                    CanShu = table.Column<string>(nullable: true),
                    TaskNum = table.Column<string>(nullable: true),
                    TestProject = table.Column<string>(nullable: true),
                    DesignValue = table.Column<string>(nullable: true),
                    MeasuredValue = table.Column<string>(nullable: true),
                    Conclusion = table.Column<string>(nullable: true),
                    RecordTime = table.Column<string>(nullable: true),
                    FileNum = table.Column<string>(nullable: true),
                    Operator = table.Column<string>(nullable: true),
                    OperatorTime = table.Column<string>(nullable: true),
                    Inspection = table.Column<string>(nullable: true),
                    InspectionTime = table.Column<string>(nullable: true),
                    Inspector = table.Column<string>(nullable: true),
                    InspectorTime = table.Column<string>(nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_MomentAndMultiMediaCheckForm", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "MomentRationCheckForm",
                columns: table => new
                {
                    Id = table.Column<Guid>(nullable: false),
                    CreationTime = table.Column<DateTime>(nullable: false),
                    CreatorUserId = table.Column<long>(nullable: true),
                    LastModificationTime = table.Column<DateTime>(nullable: true),
                    LastModifierUserId = table.Column<long>(nullable: true),
                    IsDeleted = table.Column<bool>(nullable: false),
                    DeleterUserId = table.Column<long>(nullable: true),
                    DeletionTime = table.Column<DateTime>(nullable: true),
                    InstructionEntityId = table.Column<Guid>(nullable: false),
                    Processes = table.Column<string>(nullable: true),
                    ProcessesNum = table.Column<int>(nullable: false),
                    OldId = table.Column<string>(nullable: true),
                    ModeCode = table.Column<string>(nullable: true),
                    Name = table.Column<string>(nullable: true),
                    CanShu = table.Column<string>(nullable: true),
                    TaskNum = table.Column<string>(nullable: true),
                    TestProject = table.Column<string>(nullable: true),
                    DesignValue = table.Column<string>(nullable: true),
                    MeasuredValue = table.Column<string>(nullable: true),
                    Conclusion = table.Column<string>(nullable: true),
                    Operator = table.Column<string>(nullable: true),
                    OperatorTime = table.Column<string>(nullable: true),
                    Inspection = table.Column<string>(nullable: true),
                    InspectionTime = table.Column<string>(nullable: true),
                    Inspector = table.Column<string>(nullable: true),
                    InspectorTime = table.Column<string>(nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_MomentRationCheckForm", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "MultiMediaCheckForm",
                columns: table => new
                {
                    Id = table.Column<Guid>(nullable: false),
                    CreationTime = table.Column<DateTime>(nullable: false),
                    CreatorUserId = table.Column<long>(nullable: true),
                    LastModificationTime = table.Column<DateTime>(nullable: true),
                    LastModifierUserId = table.Column<long>(nullable: true),
                    IsDeleted = table.Column<bool>(nullable: false),
                    DeleterUserId = table.Column<long>(nullable: true),
                    DeletionTime = table.Column<DateTime>(nullable: true),
                    FormEntityId = table.Column<Guid>(nullable: false),
                    Num = table.Column<int>(nullable: false),
                    InstructionEntityId = table.Column<Guid>(nullable: false),
                    Processes = table.Column<string>(nullable: true),
                    ProcessesNum = table.Column<int>(nullable: false),
                    OldId = table.Column<string>(nullable: true),
                    ModeCode = table.Column<string>(nullable: true),
                    Name = table.Column<string>(nullable: true),
                    CanShu = table.Column<string>(nullable: true),
                    TaskNum = table.Column<string>(nullable: true),
                    TestProject = table.Column<string>(nullable: true),
                    RecordTime = table.Column<string>(nullable: true),
                    FileNum = table.Column<string>(nullable: true),
                    Conclusion = table.Column<string>(nullable: true),
                    Operator = table.Column<string>(nullable: true),
                    OperatorTime = table.Column<string>(nullable: true),
                    Inspection = table.Column<string>(nullable: true),
                    InspectionTime = table.Column<string>(nullable: true),
                    Inspector = table.Column<string>(nullable: true),
                    InspectorTime = table.Column<string>(nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_MultiMediaCheckForm", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "TestRationCheckForm",
                columns: table => new
                {
                    Id = table.Column<Guid>(nullable: false),
                    CreationTime = table.Column<DateTime>(nullable: false),
                    CreatorUserId = table.Column<long>(nullable: true),
                    LastModificationTime = table.Column<DateTime>(nullable: true),
                    LastModifierUserId = table.Column<long>(nullable: true),
                    IsDeleted = table.Column<bool>(nullable: false),
                    DeleterUserId = table.Column<long>(nullable: true),
                    DeletionTime = table.Column<DateTime>(nullable: true),
                    FormEntityId = table.Column<Guid>(nullable: false),
                    Num = table.Column<int>(nullable: false),
                    InstructionEntityId = table.Column<Guid>(nullable: false),
                    Processes = table.Column<string>(nullable: true),
                    ProcessesNum = table.Column<int>(nullable: false),
                    OldId = table.Column<string>(nullable: true),
                    ModeCode = table.Column<string>(nullable: true),
                    Name = table.Column<string>(nullable: true),
                    CanShu = table.Column<string>(nullable: true),
                    TaskNum = table.Column<string>(nullable: true),
                    Cable = table.Column<string>(nullable: true),
                    ConnectorNum = table.Column<string>(nullable: true),
                    TestContent = table.Column<string>(nullable: true),
                    TestTool = table.Column<string>(nullable: true),
                    TestResult = table.Column<string>(nullable: true),
                    TestProject = table.Column<string>(nullable: true),
                    DesignValue = table.Column<string>(nullable: true),
                    MeasuredValue = table.Column<string>(nullable: true),
                    Conclusion = table.Column<string>(nullable: true),
                    Operator = table.Column<string>(nullable: true),
                    OperatorTime = table.Column<string>(nullable: true),
                    Inspection = table.Column<string>(nullable: true),
                    InspectionTime = table.Column<string>(nullable: true),
                    Inspector = table.Column<string>(nullable: true),
                    InspectorTime = table.Column<string>(nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TestRationCheckForm", x => x.Id);
                });
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "FormInstructionRelations");

            migrationBuilder.DropTable(
                name: "InstructionEntities");

            migrationBuilder.DropTable(
                name: "MomentAndMultiMediaCheckForm");

            migrationBuilder.DropTable(
                name: "MomentRationCheckForm");

            migrationBuilder.DropTable(
                name: "MultiMediaCheckForm");

            migrationBuilder.DropTable(
                name: "TestRationCheckForm");
        }
    }
}
